/*
package com.zzz.springbootdemo.controller;

import com.zzz.springbootdemo.service.impl.ActiveMqServiceImpl;
import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.jms.Destination;
import javax.jms.Queue;

@RestController
@RequestMapping("/jmsa")
public class Demo13ActiveMQController {
    @Autowired
    private ActiveMqServiceImpl service;
    @RequestMapping("/t1")
    public String sendMessage(int n) {
        for (int i = 0; i < n; i++) {
            service.sendMessage("Q1-TEST-" + i);
        }
        return "successful";
    }
    @RequestMapping("/t2")
    public String sendMessage2(int n) {
        Destination destination = new ActiveMQQueue("AMQ1");
        for (int i = 0; i < n; i++) {
            service.sendMessage(destination, "AMQ1-test-" + i);
        }
        return "successful";
    }
    @RequestMapping("/t3")
    public String publish(int n) {
        for (int i = 0; i < n; i++) {
            service.publish("Topic-test-" + i);
        }
        return "successful";
    }
}
*/
